A Proof-Theoretic Assessment of Runtime Type Errors
نویسنده
چکیده
We analyze the way in which a result concerning the absence of runtime type errors can be expressed when the semantics of a language is described using proof rules in what is sometimes called a natural semantics. We argue that the usual way of expressing such results has conceptual short-comings when compared with similar results for other methods of describing semantics. These short-comings are addressed through a form of operational semantics based on proof rules in what we call a partial proof semantics. A partial proof semantics represents steps of evaluation using proofs with logic variables and subgoals. Such a semantics allows a prooftheoretic expression of the absence of runtime type errors that addresses the problems with such results for natural semantics. We demonstrate that there is a close correspondence between partial proof semantics and a form of structural operational semantics that uses a grammar to describe evaluation contexts and rules for the evaluation of redexes that may appear in such contexts. Indeed, partial proof semantics can be seen as an intermediary between such a description and one using natural semantics. Our study is based on a case treatment for a language called RAVL for Records And Variants Language, which has a polymorphic type system that supports exible programming with records and variants. 1 Runtime Type Errors in Natural Semantics One of the primary purposes for imposing a type discipline on a programming language is to ensure the absence of certain forms of data incompatibilities that might occur at runtime in the evaluation of an ill-typed program. A characterisitic instance of such a problem occurs when a procedure call is made on an actual parameter that fails to have the proper form demanded of the formal parameter of the procedure. Such a guarantee of runtime safety can often be expressed precisely and proved rigorously for a clean language design. One of the earliest examples of such a treatment appeared in Milner's paper [Mil78] introducing the type system that forms the basis for the Standard Meta-Language (SML) [MTH90, MT91]. Similar results have been stated and proved for many subsequent language designs involving types and semantic speci cations. The goal of this paper is to study some of the relationships between various approaches to such results and use this perspective as a basis for describing a new form of operational speci cation for which it is possible to provide a proof-theoretic expression of the guarantees obtained from the type correctness of a program.
منابع مشابه
Dependent types ensure partial correctness of theorem provers
Static type systems in programming languages allow many errors to be detected at compile time that wouldn't be detected until runtime otherwise. Dependent types are more expressive than the type systems in most programming languages, so languages that have them should allow programmers to detect more errors earlier. In this paper, using the Twelf system, we show that dependent types in the logi...
متن کاملBlame Prediction
Static type systems are usually conservative. Therefore, many interesting programs are rejected by the type system, even though they often execute without errors. Dynamic type systems would allow such ill-typed programs to run. However, the cause of runtime errors is often far removed from the place where the type errors are raised, making the program hard to debug. We present a hybrid typing d...
متن کاملFormalisation of the lambda aleph Runtime
Strong static type systems eliminate errors. Compilers refuse to compile programs that fail the type discipline, guaranteeing that those programs that pass the discipline are free of a certain category of errors. For mainstream programming languages that category of errors includes applying primitive operations to values of inappropriate type, calling something that is not a function, subscript...
متن کاملDisciplined structured communications with disciplined runtime adaptation
Session types offer a powerful type-theoretic foundation for the analysis of structured communications, as commonly found in service-oriented systems. They are defined upon core programming calculi which offer only limited support for expressing requirements related to runtime adaptation. This is unfortunate, as service-oriented systems are increasingly being deployed upon highly dynamic infras...
متن کاملCuckoo Cycle: A Memory Bound Graph-Theoretic Proof-of-Work
We introduce the first graph-theoretic proof-of-work system, based on finding small cycles or other structures in large random graphs. Such problems are trivially verifiable and arbitrarily scalable, presumably requiring memory linear in graph size to solve efficiently. Our cycle finding algorithm uses one bit per edge, and up to one bit per node. Runtime is linear in graph size and dominated b...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1993